10 void articulation_point_visit
11 (vector
<int> *list
, int* d
, int* low
, int* child_cnt
, int n
, int& time
){
14 for(int v
, i
=0; i
<l
; i
++){
18 articulation_point_visit(list
, d
, low
, child_cnt
, v
, time
);
26 vector
<int> articulation_point(vector
<int> *list
, int sz
){
28 int d
[sz
+1], low
[sz
+1], child_cnt
[sz
+1], time
=1, l
;
29 for(int i
=1; i
<=sz
; i
++){ root
[i
]=false; d
[i
]=0; child_cnt
[i
]=0;}
32 for(int i
=1; i
<=sz
; i
++) if(d
[i
]==0){
34 articulation_point_visit(list
, d
, low
, child_cnt
, i
, time
);
36 for(int i
=1; i
<=sz
; i
++){
37 if(root
[i
]&&(child_cnt
[i
]>1)) points
.push_back(i
);
40 for(int j
=0; j
<l
; j
++) if(d
[i
]<=low
[list
[i
][j
]]){ points
.push_back(i
); break;}
48 //freopen("input.txt", "r", stdin);
58 if(cnt
>1) printf("\n");
59 m
.clear(); mi
.clear(); vec
.clear();
60 for(int c
=1, i
=0; i
<n
; i
++, c
++){
65 vector
<int> list
[n
+1];
66 for(int x
, y
, i
=0; i
<r
; i
++){
72 points
=articulation_point(list
, n
);
73 printf("City map #%d: %d camera(s) found\n", cnt
++, points
.size());
74 for(vector
<int>::iterator it
=points
.begin(); it
!=points
.end(); it
++)
75 vec
.push_back(mi
[*it
]);
76 sort(vec
.begin(), vec
.end());
77 for(vector
<string
>::iterator it
=vec
.begin(); it
!=vec
.end(); it
++) cout
<<*it
<<endl
;